import request from '@/utils/request'

/**
 * 获取列表数据
 */
export function getArticleList (params) {
  return request({
    url: '/article/list',
    params
  })
}

/**
  * 修改排序
  */
export function articleSort (data) {
  return request({
    url: '/article/sort',
    method: 'POST',
    data
  })
}

/**
  * 删除文章
  */
export function deleteArticle (articleId) {
  return request({
    url: `/article/delete/${articleId}`,
    method: 'delete'
  })
}

/**
    * 获取文章详情
    */
export function articleDetail (articleId) {
  return request({
    url: `/article/${articleId}`
  })
}

/**
* 创建文章
*/
export function createArticle (data) {
  return request({
    url: '/article/create',
    method: 'POST',
    data
  })
}

/**
  * 编辑文章详情
  */
export function articleEdit (data) {
  return request({
    url: '/article/edit',
    method: 'POST',
    data
  })
}
